<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title>Realtime Web Apps &ndash; Exercise 3-3</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type='text/javascript' src="js/jquery-1.10.2.min.js"></script>
    </head>
    <body>
        <h1>Testing Pusher</h1>
        <div id="connection_state">&dash;</div>
        <div id='result'></div>
        <p>This is a simple demo of how easy it is integrate Pusher into your app</p>
        <script type='text/javascript' src='js/pusher.min.js'></script> 
<!--        <script src="http://js.pusher.com/1.12/pusher.min.js"></script>-->
        <script type='text/javascript'>
            var appKey = 'cbd68254534cdd922e63';
            var pusher = new Pusher(appKey);
            
            pusher.connection.bind( 'state_change', function( change ) {
                $('#connection_state').html(change.current);
            });
            
            var channel = pusher.subscribe('test_channel');
            channel.bind('my_event', function(data){
                $('#result').empty().html(data);
            });
        </script>
    </body>
</html>